<?php

namespace Sayari\UserBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CandidatsType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('firstname')
            ->add('address')
            ->add('phone')
            ->add('cv_file')
            ->add('photo_file')
            ->add('user', new UsersType())
            ->add('region')
            ->add('specialite')
            ->add('fonction')
            ->add('niveau_etude')
            ->add('niveau_experience')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Sayari\UserBundle\Entity\Candidats'
        ));
    }

    public function getName()
    {
        return 'sayari_userbundle_candidatstype';
    }
}
